home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Icons.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  12.9 KB  |  588 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Icons.a
  3. ;
  4. ;    Contains:    Icon Utilities Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  21. __ICONS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  30.     include 'Quickdraw.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33. ;        include 'QuickdrawText.a'                                    ;
  34.  
  35. ; The following are icons for which there are both icon suites and SICNs. 
  36. genericDocumentIconResource        EQU        -4000
  37. genericStationeryIconResource    EQU        -3985
  38. genericEditionFileIconResource    EQU        -3989
  39. genericApplicationIconResource    EQU        -3996
  40. genericDeskAccessoryIconResource EQU        -3991
  41. genericFolderIconResource        EQU        -3999
  42. privateFolderIconResource        EQU        -3994
  43. floppyIconResource                EQU        -3998
  44. trashIconResource                EQU        -3993
  45. ; The following are icons for which there are SICNs only. 
  46. desktopIconResource                EQU        -3992
  47. openFolderIconResource            EQU        -3997
  48. genericHardDiskIconResource        EQU        -3995
  49. genericFileServerIconResource    EQU        -3972
  50. genericSuitcaseIconResource        EQU        -3970
  51. genericMoverObjectIconResource    EQU        -3969
  52. ; The following are icons for which there are icon suites only. 
  53. genericPreferencesIconResource    EQU        -3971
  54. genericQueryDocumentIconResource EQU        -16506
  55. genericExtensionIconResource    EQU        -16415
  56. systemFolderIconResource        EQU        -3983
  57. appleMenuFolderIconResource        EQU        -3982
  58.  
  59. startupFolderIconResource        EQU        -3981
  60. ownedFolderIconResource            EQU        -3980
  61. dropFolderIconResource            EQU        -3979
  62. sharedFolderIconResource        EQU        -3978
  63. mountedFolderIconResource        EQU        -3977
  64. controlPanelFolderIconResource    EQU        -3976
  65. printMonitorFolderIconResource    EQU        -3975
  66. preferencesFolderIconResource    EQU        -3974
  67. extensionsFolderIconResource    EQU        -3973
  68. fontsFolderIconResource            EQU        -3968
  69. fullTrashIconResource            EQU        -3984
  70. large1BitMask                    EQU        'ICN#'
  71. large4BitData                    EQU        'icl4'
  72. large8BitData                    EQU        'icl8'
  73. small1BitMask                    EQU        'ics#'
  74. small4BitData                    EQU        'ics4'
  75. small8BitData                    EQU        'ics8'
  76. mini1BitMask                    EQU        'icm#'
  77. mini4BitData                    EQU        'icm4'
  78. mini8BitData                    EQU        'icm8'
  79.  
  80. ;  alignment type values  
  81. atNone                            EQU        $0
  82. atVerticalCenter                EQU        $1
  83. atTop                            EQU        $2
  84. atBottom                        EQU        $3
  85. atHorizontalCenter                EQU        $4
  86. atAbsoluteCenter                EQU        atVerticalCenter | atHorizontalCenter
  87. atCenterTop                        EQU        atTop | atHorizontalCenter
  88. atCenterBottom                    EQU        atBottom | atHorizontalCenter
  89. atLeft                            EQU        $8
  90. atCenterLeft                    EQU        atVerticalCenter | atLeft
  91. atTopLeft                        EQU        atTop | atLeft
  92. atBottomLeft                    EQU        atBottom | atLeft
  93. atRight                            EQU        $C
  94. atCenterRight                    EQU        atVerticalCenter | atRight
  95. atTopRight                        EQU        atTop | atRight
  96. atBottomRight                    EQU        atBottom | atRight
  97.  
  98. ; typedef short             IconAlignmentType
  99. ;  transform type values  
  100.  
  101. ttNone                            EQU        $0
  102. ttDisabled                        EQU        $1
  103. ttOffline                        EQU        $2
  104. ttOpen                            EQU        $3
  105. ttLabel1                        EQU        $0100
  106. ttLabel2                        EQU        $0200
  107. ttLabel3                        EQU        $0300
  108. ttLabel4                        EQU        $0400
  109. ttLabel5                        EQU        $0500
  110. ttLabel6                        EQU        $0600
  111. ttLabel7                        EQU        $0700
  112. ttSelected                        EQU        $4000
  113. ttSelectedDisabled                EQU        ttSelected | ttDisabled
  114. ttSelectedOffline                EQU        ttSelected | ttOffline
  115. ttSelectedOpen                    EQU        ttSelected | ttOpen
  116.  
  117. ; typedef short             IconTransformType
  118. ;  Selector mask values  
  119.  
  120. svLarge1Bit                        EQU        $00000001
  121. svLarge4Bit                        EQU        $00000002
  122. svLarge8Bit                        EQU        $00000004
  123. svSmall1Bit                        EQU        $00000100
  124. svSmall4Bit                        EQU        $00000200
  125. svSmall8Bit                        EQU        $00000400
  126. svMini1Bit                        EQU        $00010000
  127. svMini4Bit                        EQU        $00020000
  128. svMini8Bit                        EQU        $00040000
  129. svAllLargeData                    EQU        $000000ff
  130. svAllSmallData                    EQU        $0000ff00
  131. svAllMiniData                    EQU        $00ff0000
  132. svAll1BitData                    EQU        svLarge1Bit | svSmall1Bit | svMini1Bit
  133. svAll4BitData                    EQU        svLarge4Bit | svSmall4Bit | svMini4Bit
  134. svAll8BitData                    EQU        svLarge8Bit | svSmall8Bit | svMini8Bit
  135. svAllAvailableData                EQU        $ffffffff
  136.  
  137. ; typedef unsigned long     IconSelectorValue
  138. ; typedef IconActionProcPtr  IconAction
  139. ; typedef IconGetterProcPtr  IconGetter
  140.     IF ¬ OLDROUTINELOCATIONS  THEN
  141. CIcon                     RECORD    0
  142. iconPMap                 ds     PixMap    ; offset: $0 (0)        ;the icon's pixMap
  143. iconMask                 ds     BitMap    ; offset: $32 (50)        ;the icon's mask
  144. iconBMap                 ds     BitMap    ; offset: $40 (64)        ;the icon's bitMap
  145. iconData                 ds.l   1        ; offset: $4E (78)        ;the icon's data
  146. iconMaskData             ds.w   1        ; offset: $52 (82)        ;icon's mask and BitMap data
  147. sizeof                     EQU *            ; size:   $54 (84)
  148.                         ENDR
  149.  
  150. ; typedef struct CIcon         CIcon, *CIconPtr, **CIconHandle
  151. ;
  152. ; pascal CIconHandle GetCIcon(short iconID)
  153. ;
  154.     IF ¬ GENERATINGCFM THEN
  155.         _GetCIcon:    OPWORD    $AA1E
  156.     ELSE
  157.         IMPORT_CFM_FUNCTION    GetCIcon
  158.     ENDIF
  159.  
  160. ;
  161. ; pascal void PlotCIcon(const Rect *theRect, CIconHandle theIcon)
  162. ;
  163.     IF ¬ GENERATINGCFM THEN
  164.         _PlotCIcon:    OPWORD    $AA1F
  165.     ELSE
  166.         IMPORT_CFM_FUNCTION    PlotCIcon
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal void DisposeCIcon(CIconHandle theIcon)
  171. ;
  172.     IF ¬ GENERATINGCFM THEN
  173.         _DisposeCIcon:    OPWORD    $AA25
  174.     ELSE
  175.         IMPORT_CFM_FUNCTION    DisposeCIcon
  176.     ENDIF
  177.  
  178. ;
  179. ; pascal Handle GetIcon(short iconID)
  180. ;
  181.     IF ¬ GENERATINGCFM THEN
  182.         _GetIcon:    OPWORD    $A9BB
  183.     ELSE
  184.         IMPORT_CFM_FUNCTION    GetIcon
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal void PlotIcon(const Rect *theRect, Handle theIcon)
  189. ;
  190.     IF ¬ GENERATINGCFM THEN
  191.         _PlotIcon:    OPWORD    $A94B
  192.     ELSE
  193.         IMPORT_CFM_FUNCTION    PlotIcon
  194.     ENDIF
  195.  
  196.     ENDIF
  197. ;
  198. ; pascal OSErr PlotIconID(const Rect *theRect, IconAlignmentType align, IconTransformType transform, short theResID)
  199. ;
  200.     IF ¬ GENERATINGCFM THEN
  201.         Macro
  202.         _PlotIconID
  203.             move.w    #$0500,d0
  204.             dc.w     $ABC9
  205.         EndM
  206.     ELSE
  207.         IMPORT_CFM_FUNCTION    PlotIconID
  208.     ENDIF
  209.  
  210. ;
  211. ; pascal OSErr NewIconSuite(Handle *theIconSuite)
  212. ;
  213.     IF ¬ GENERATINGCFM THEN
  214.         Macro
  215.         _NewIconSuite
  216.             move.w    #$0207,d0
  217.             dc.w     $ABC9
  218.         EndM
  219.     ELSE
  220.         IMPORT_CFM_FUNCTION    NewIconSuite
  221.     ENDIF
  222.  
  223. ;
  224. ; pascal OSErr AddIconToSuite(Handle theIconData, Handle theSuite, ResType theType)
  225. ;
  226.     IF ¬ GENERATINGCFM THEN
  227.         Macro
  228.         _AddIconToSuite
  229.             move.w    #$0608,d0
  230.             dc.w     $ABC9
  231.         EndM
  232.     ELSE
  233.         IMPORT_CFM_FUNCTION    AddIconToSuite
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal OSErr GetIconFromSuite(Handle *theIconData, Handle theSuite, ResType theType)
  238. ;
  239.     IF ¬ GENERATINGCFM THEN
  240.         Macro
  241.         _GetIconFromSuite
  242.             move.w    #$0609,d0
  243.             dc.w     $ABC9
  244.         EndM
  245.     ELSE
  246.         IMPORT_CFM_FUNCTION    GetIconFromSuite
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal OSErr ForEachIconDo(Handle theSuite, IconSelectorValue selector, IconActionUPP action, void *yourDataPtr)
  251. ;
  252.     IF ¬ GENERATINGCFM THEN
  253.         Macro
  254.         _ForEachIconDo
  255.             move.w    #$080A,d0
  256.             dc.w     $ABC9
  257.         EndM
  258.     ELSE
  259.         IMPORT_CFM_FUNCTION    ForEachIconDo
  260.     ENDIF
  261.  
  262. ;
  263. ; pascal OSErr GetIconSuite(Handle *theIconSuite, short theResID, IconSelectorValue selector)
  264. ;
  265.     IF ¬ GENERATINGCFM THEN
  266.         Macro
  267.         _GetIconSuite
  268.             move.w    #$0501,d0
  269.             dc.w     $ABC9
  270.         EndM
  271.     ELSE
  272.         IMPORT_CFM_FUNCTION    GetIconSuite
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal OSErr DisposeIconSuite(Handle theIconSuite, Boolean disposeData)
  277. ;
  278.     IF ¬ GENERATINGCFM THEN
  279.         Macro
  280.         _DisposeIconSuite
  281.             move.w    #$0302,d0
  282.             dc.w     $ABC9
  283.         EndM
  284.     ELSE
  285.         IMPORT_CFM_FUNCTION    DisposeIconSuite
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal OSErr PlotIconSuite(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconSuite)
  290. ;
  291.     IF ¬ GENERATINGCFM THEN
  292.         Macro
  293.         _PlotIconSuite
  294.             move.w    #$0603,d0
  295.             dc.w     $ABC9
  296.         EndM
  297.     ELSE
  298.         IMPORT_CFM_FUNCTION    PlotIconSuite
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal OSErr MakeIconCache(Handle *theHandle, IconGetterUPP makeIcon, void *yourDataPtr)
  303. ;
  304.     IF ¬ GENERATINGCFM THEN
  305.         Macro
  306.         _MakeIconCache
  307.             move.w    #$0604,d0
  308.             dc.w     $ABC9
  309.         EndM
  310.     ELSE
  311.         IMPORT_CFM_FUNCTION    MakeIconCache
  312.     ENDIF
  313.  
  314. ;
  315. ; pascal OSErr LoadIconCache(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconCache)
  316. ;
  317.     IF ¬ GENERATINGCFM THEN
  318.         Macro
  319.         _LoadIconCache
  320.             move.w    #$0606,d0
  321.             dc.w     $ABC9
  322.         EndM
  323.     ELSE
  324.         IMPORT_CFM_FUNCTION    LoadIconCache
  325.     ENDIF
  326.  
  327. ;
  328. ; pascal OSErr PlotIconMethod(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconGetterUPP theMethod, void *yourDataPtr)
  329. ;
  330.     IF ¬ GENERATINGCFM THEN
  331.         Macro
  332.         _PlotIconMethod
  333.             move.w    #$0805,d0
  334.             dc.w     $ABC9
  335.         EndM
  336.     ELSE
  337.         IMPORT_CFM_FUNCTION    PlotIconMethod
  338.     ENDIF
  339.  
  340. ;
  341. ; pascal OSErr GetLabel(short labelNumber, RGBColor *labelColor, Str255 labelString)
  342. ;
  343.     IF ¬ GENERATINGCFM THEN
  344.         Macro
  345.         _GetLabel
  346.             move.w    #$050B,d0
  347.             dc.w     $ABC9
  348.         EndM
  349.     ELSE
  350.         IMPORT_CFM_FUNCTION    GetLabel
  351.     ENDIF
  352.  
  353. ;
  354. ; pascal Boolean PtInIconID(Point testPt, const Rect *iconRect, IconAlignmentType align, short iconID)
  355. ;
  356.     IF ¬ GENERATINGCFM THEN
  357.         Macro
  358.         _PtInIconID
  359.             move.w    #$060D,d0
  360.             dc.w     $ABC9
  361.         EndM
  362.     ELSE
  363.         IMPORT_CFM_FUNCTION    PtInIconID
  364.     ENDIF
  365.  
  366. ;
  367. ; pascal Boolean PtInIconSuite(Point testPt, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
  368. ;
  369.     IF ¬ GENERATINGCFM THEN
  370.         Macro
  371.         _PtInIconSuite
  372.             move.w    #$070E,d0
  373.             dc.w     $ABC9
  374.         EndM
  375.     ELSE
  376.         IMPORT_CFM_FUNCTION    PtInIconSuite
  377.     ENDIF
  378.  
  379. ;
  380. ; pascal Boolean PtInIconMethod(Point testPt, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  381. ;
  382.     IF ¬ GENERATINGCFM THEN
  383.         Macro
  384.         _PtInIconMethod
  385.             move.w    #$090F,d0
  386.             dc.w     $ABC9
  387.         EndM
  388.     ELSE
  389.         IMPORT_CFM_FUNCTION    PtInIconMethod
  390.     ENDIF
  391.  
  392. ;
  393. ; pascal Boolean RectInIconID(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, short iconID)
  394. ;
  395.     IF ¬ GENERATINGCFM THEN
  396.         Macro
  397.         _RectInIconID
  398.             move.w    #$0610,d0
  399.             dc.w     $ABC9
  400.         EndM
  401.     ELSE
  402.         IMPORT_CFM_FUNCTION    RectInIconID
  403.     ENDIF
  404.  
  405. ;
  406. ; pascal Boolean RectInIconSuite(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
  407. ;
  408.     IF ¬ GENERATINGCFM THEN
  409.         Macro
  410.         _RectInIconSuite
  411.             move.w    #$0711,d0
  412.             dc.w     $ABC9
  413.         EndM
  414.     ELSE
  415.         IMPORT_CFM_FUNCTION    RectInIconSuite
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal Boolean RectInIconMethod(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  420. ;
  421.     IF ¬ GENERATINGCFM THEN
  422.         Macro
  423.         _RectInIconMethod
  424.             move.w    #$0912,d0
  425.             dc.w     $ABC9
  426.         EndM
  427.     ELSE
  428.         IMPORT_CFM_FUNCTION    RectInIconMethod
  429.     ENDIF
  430.  
  431. ;
  432. ; pascal OSErr IconIDToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, short iconID)
  433. ;
  434.     IF ¬ GENERATINGCFM THEN
  435.         Macro
  436.         _IconIDToRgn
  437.             move.w    #$0613,d0
  438.             dc.w     $ABC9
  439.         EndM
  440.     ELSE
  441.         IMPORT_CFM_FUNCTION    IconIDToRgn
  442.     ENDIF
  443.  
  444. ;
  445. ; pascal OSErr IconSuiteToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
  446. ;
  447.     IF ¬ GENERATINGCFM THEN
  448.         Macro
  449.         _IconSuiteToRgn
  450.             move.w    #$0714,d0
  451.             dc.w     $ABC9
  452.         EndM
  453.     ELSE
  454.         IMPORT_CFM_FUNCTION    IconSuiteToRgn
  455.     ENDIF
  456.  
  457. ;
  458. ; pascal OSErr IconMethodToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  459. ;
  460.     IF ¬ GENERATINGCFM THEN
  461.         Macro
  462.         _IconMethodToRgn
  463.             move.w    #$0915,d0
  464.             dc.w     $ABC9
  465.         EndM
  466.     ELSE
  467.         IMPORT_CFM_FUNCTION    IconMethodToRgn
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
  472. ;
  473.     IF ¬ GENERATINGCFM THEN
  474.         Macro
  475.         _SetSuiteLabel
  476.             move.w    #$0316,d0
  477.             dc.w     $ABC9
  478.         EndM
  479.     ELSE
  480.         IMPORT_CFM_FUNCTION    SetSuiteLabel
  481.     ENDIF
  482.  
  483. ;
  484. ; pascal short GetSuiteLabel(Handle theSuite)
  485. ;
  486.     IF ¬ GENERATINGCFM THEN
  487.         Macro
  488.         _GetSuiteLabel
  489.             move.w    #$0217,d0
  490.             dc.w     $ABC9
  491.         EndM
  492.     ELSE
  493.         IMPORT_CFM_FUNCTION    GetSuiteLabel
  494.     ENDIF
  495.  
  496. ;
  497. ; pascal OSErr GetIconCacheData(Handle theCache, void **theData)
  498. ;
  499.     IF ¬ GENERATINGCFM THEN
  500.         Macro
  501.         _GetIconCacheData
  502.             move.w    #$0419,d0
  503.             dc.w     $ABC9
  504.         EndM
  505.     ELSE
  506.         IMPORT_CFM_FUNCTION    GetIconCacheData
  507.     ENDIF
  508.  
  509. ;
  510. ; pascal OSErr SetIconCacheData(Handle theCache, void *theData)
  511. ;
  512.     IF ¬ GENERATINGCFM THEN
  513.         Macro
  514.         _SetIconCacheData
  515.             move.w    #$041A,d0
  516.             dc.w     $ABC9
  517.         EndM
  518.     ELSE
  519.         IMPORT_CFM_FUNCTION    SetIconCacheData
  520.     ENDIF
  521.  
  522. ;
  523. ; pascal OSErr GetIconCacheProc(Handle theCache, IconGetterUPP *theProc)
  524. ;
  525.     IF ¬ GENERATINGCFM THEN
  526.         Macro
  527.         _GetIconCacheProc
  528.             move.w    #$041B,d0
  529.             dc.w     $ABC9
  530.         EndM
  531.     ELSE
  532.         IMPORT_CFM_FUNCTION    GetIconCacheProc
  533.     ENDIF
  534.  
  535. ;
  536. ; pascal OSErr SetIconCacheProc(Handle theCache, IconGetterUPP theProc)
  537. ;
  538.     IF ¬ GENERATINGCFM THEN
  539.         Macro
  540.         _SetIconCacheProc
  541.             move.w    #$041C,d0
  542.             dc.w     $ABC9
  543.         EndM
  544.     ELSE
  545.         IMPORT_CFM_FUNCTION    SetIconCacheProc
  546.     ENDIF
  547.  
  548. ;
  549. ; pascal OSErr PlotIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon)
  550. ;
  551.     IF ¬ GENERATINGCFM THEN
  552.         Macro
  553.         _PlotIconHandle
  554.             move.w    #$061D,d0
  555.             dc.w     $ABC9
  556.         EndM
  557.     ELSE
  558.         IMPORT_CFM_FUNCTION    PlotIconHandle
  559.     ENDIF
  560.  
  561. ;
  562. ; pascal OSErr PlotSICNHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN)
  563. ;
  564.     IF ¬ GENERATINGCFM THEN
  565.         Macro
  566.         _PlotSICNHandle
  567.             move.w    #$061E,d0
  568.             dc.w     $ABC9
  569.         EndM
  570.     ELSE
  571.         IMPORT_CFM_FUNCTION    PlotSICNHandle
  572.     ENDIF
  573.  
  574. ;
  575. ; pascal OSErr PlotCIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon)
  576. ;
  577.     IF ¬ GENERATINGCFM THEN
  578.         Macro
  579.         _PlotCIconHandle
  580.             move.w    #$061F,d0
  581.             dc.w     $ABC9
  582.         EndM
  583.     ELSE
  584.         IMPORT_CFM_FUNCTION    PlotCIconHandle
  585.     ENDIF
  586.  
  587.     ENDIF ; __ICONS__
  588.